#include <iostream>

using namespace std;

const int N = 110;

int dp[N];
int n, m;

int main()
{
	cin >> n >> m;
	
	dp[0] = 1;
	
	for (int i = 0; i < n; i ++ )
	{
		int v;
		cin >> v;
		
		for (int j = m; j >= v; j -- )
		{
			dp[j] += dp[j - v];
		}
	}
	
	cout << dp[m] << endl;
	
	return 0;
}
